/*
 * @Date         : 2022-06-08 09:54:17
 * @LastEditors  : zu1662
 * @LastEditTime : 2022-06-30 19:49:52
 * @Description  : 文件 Entity
 * 
 * Copyright © 2022 by zu1662, All Rights Reserved. 
 */
import { ApiProperty } from '@nestjs/swagger';
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity({ name: 'file' })
export class FileEntity {
  @ApiProperty()
  @PrimaryGeneratedColumn('uuid')
  id?: string;

  @ApiProperty()
  @Column({ charset: 'utf8mb4' })
  originalname: string; // 文件名

  @ApiProperty()
  @Column({ charset: 'utf8mb4' })
  filename: string; // 文件名

  @ApiProperty()
  @Column()
  type: string; // 文件信息

  @ApiProperty()
  @Column()
  size: number; // 文件大小

  @ApiProperty()
  @Column({ charset: 'utf8mb4' })
  url: string;

  @ApiProperty()
  @CreateDateColumn({
    type: 'datetime',
    comment: '创建时间',
    name: 'create_at',
  })
  createAt?: Date;
}
